package 如何初始化数组;

public class 数组反转14 {
	public static void main(String[] args) {
        int[] a = new int[5];
        for(int i=0;i<a.length;i++) {
            a[i] = (int)(Math.random()*100);
        }
        //赋值后的数组
        for (int i : a) {
            System.out.print(i+" ");
        }
        System.out.println();      
        //数组反转 倒叙输出
        for(int i=a.length-1;i>=0;i--) {
            System.out.print(a[i]+" ");
        }
    }
}